<?php

declare(strict_types=1);
/**
 * This file is part of MineAdmin.
 *
 * @link     https://www.mineadmin.com
 * @document https://doc.mineadmin.com
 * @contact  root@imoi.cn
 * @license  https://github.com/mineadmin/MineAdmin/blob/master/LICENSE
 */

namespace App\Http\Admin\Request\Classroom;

use App\Schema\ClassroomSchema;
use Hyperf\Validation\Request\FormRequest;
use Mine\Swagger\Attributes\FormRequest as FormRequestAnnotation;

#[FormRequestAnnotation(
    schema: ClassroomSchema::class,
    title: '创建班级',
    required: [
        'name'
    ],
    only: [
        'name'
    ]
)]
class ClassroomRequest extends FormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'name' => 'required|string|max:20',
            "school_id" => 'required',
            "department_id" => 'required',
            "teacher_id" => 'required',
            'teacher_ids' => 'array'
        ];
    }

    public function attributes(): array
    {
        return [
            'name' => trans('classroom.name'),
            "school_id" => trans('classroom.school_id'),
            "department_id" => trans('classroom.department_id'),
            "teacher_id" => trans('classroom.teacher_id'),

        ];
    }
}
